services:
  bot:
    build:
      context: bot
      dockerfile: bot/Dockerfile
    command: python3 main.py
    volumes:
      - ./bot:/app
    restart: unless-stopped
  postgres:
    image: postgres:latest
    volumes:
      - ${DB_VOLUME}
    ports:
      - "5432:5432"
    restart: unless-stopped
    env_file:
      - .env.postgres
  fastapi:
    build:
      context: fastapi_module
      dockerfile: fastapi_module/Dockerfile
    command: fastapi run
    volumes:
      - ./fastapi_module:/app
    ports:
      - "8000:8000"
    restart: unless-stopped
    env_file:
      - .env.fastapi
  frontend:
    build:
      context: frontend
      dockerfile: frontend/Dockerfile
    command: npm run start
    ports:
      - "3000:3000"
    restart: unless-stopped
  nginx:
    image: nginx:1.21.3
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
      - /etc/letsencrypt:/etc/letsencrypt
    restart: unless-stopped
networks:
  default:
    external: true
    name: booking_service_network